//
// Copyright (C) OpenSim Ltd.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program; if not, see <http://www.gnu.org/licenses/>.
//


#ifndef SWITCH_H_
#define SWITCH_H_

#include <omnetpp.h>
#include <map>
#include <string>
#include <string.h>
#include <vector>


class IBSwitch : public omnetpp::cSimpleModule {
public:
    std::map<int,int> outportgateId_map;
    std::map<int,int> inportgateId_map;
protected:
    int cross_connected_upperlevel_numswitch;
    int total_level_switch;

    int switch_index; 
    bool is_cross_connected; // true indicates the current switch is cross_connected to it's upper level switch
    int numSwitchPorts;     // Total num of switch ports for each switch

    double ISWDelay; // Delay brought by IBUF in SWitch
    double VSWDelay; // Delay in ns brought by IBUF in Switch
    //std::string pktFwdType;         // The type of the packet forwarding engine to use
    virtual void initialize();
};
#endif /* SWITCH_H_ */
